<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<title>模块资源</title>
<head th:replace="system/inc/incHead :: incHead"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content no-padding">
    <div class="row no-padding no-margins">
        <div class="col-sm-3 no-padding no-margins">
            <div class="ibox no-margins">
                <div class="ibox-content" style="padding:8px 20px;">
                    <div class="row">
                        <div class="form-group no-padding no-margins">
                            <div class="input-group">
                                <span class="input-group-addon">部署系统:</span>
                                <select class="chosen-select selectSystem" style="width:100%;" name="systemId" data-placeholder="请选择部署系统"
                                        th:field="${sysSystem.id}">
                                    <option th:each="item:${systems}" th:value="${item.id}" hassubinfo="true" th:text="${item.systemName}"></option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div th:unless="${#lists.isEmpty(sysGroups)}" class="ibox-content m-t-md" layoutH="105">
                    <div class="file-manager">
                        <h5>其它角色</h5>
                        <div class="hr-line-dashed"></div>
                        <ul class="folder-list" style="padding: 0">
                            <li th:each="item:${sysGroups}" class="p-xxs">
                                <a th:if="${sysGroup.id == item.id}" href="javascript:;"><i class="fa fa-cube"></i>
                                    <selection class="text-info">[[${item.groupSort}]]:[[${item.groupName}]]</selection>
                                </a>
                                <a th:if="${sysGroup.id != item.id}"
                                   th:href="|/sys/user?sid=${sysSystem.id}&gid=${item.id}|"><i class="fa fa-cube"></i>
                                    [[${item.groupSort}]]:[[${item.groupName}]]
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-9 no-margins">
            <div th:if="${sid} != null and ${gid} != null" class="row no-padding no-margins">
                <div class="col-sm-12 no-padding no-margins">
                    <div class="ibox no-margins">
                        <div class="ibox-title no-borders">
                            <th:block th:if="${@lj.limit('SysUserAdd')>0}">
                                <div class="btn btn-sm btn-info pull-left" type="button" th:ljUrl="|/sys/user/add?sid=${sid}&gid=${gid}|"
                                     title="添加角色用户"
                                     target="ljOpenCon" ljWidth="800px">
                                    <i class="fa fa-paste">添加角色用户</i>
                                </div>
                            </th:block>
                            <form id="pagerForm" action="/sys/user" method="get">
                                <input type="hidden" id="sid" name="sid" th:value="${sid}"/>
                                <input type="hidden" id="gid" name="gid" th:value="${gid}"/>
                                <input type="hidden" id="pageNum" name="pageNum" value="1"/>
                                <input type="hidden" name="numPerPage" th:value="${page.numPerPage}"/>
                                <input type="hidden" name="orderField" th:value="${orderField}"/>
                                <input type="hidden" name="orderDirection" th:value="${orderDirection}"/>
                                <div class="form-group col-md-4 no-margins">
                                    <div class="input-group m-l-sm">
                                        <span class="input-group-addon">模糊检索:</span>
                                        <input name="filterValue" type="text" class="form-control input-sm" th:value="${filterValue}">
                                        <span class="input-group-addon btnPagerForm"><i class="fa fa-search"></i></span>
                                    </div>
                                </div>
                            </form>
                            <div class="btn btn-white btn-bitbucket btn-sm pull-right btnPageRefresh"><i class="fa fa-refresh">页面刷新</i></div>
                        </div>
                        <div class="ibox-content ljScrollbar3" style="padding:10px;" layoutH="112">
                            <table class="table table-striped table-bordered table-hover table-responsive lj-table-nowrap">
                                <thead>
                                <tr>
                                    <th style="width:60px;" class="text-center">编号</th>
                                    <th style="width:120px;">登录账户</th>
                                    <th style="width:120px;">用户昵称</th>
                                    <th style="width:100px;">用户手机</th>
                                    <th style="width:150px;">用户邮箱</th>
                                    <th style="width:80px;" class="text-center">权限类型</th>
                                    <th style="width:130px;">创建时间</th>
                                    <th style="width:200px;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="item:${records}" class="warning">
                                    <td class="text-center">[[${item.id}]]</td>
                                    <td>[[${item.loginName}]]</td>
                                    <td>[[${item.userNick}]]</td>
                                    <td>[[${item.userPhone}]]</td>
                                    <td>[[${item.userEmail}]]</td>
                                    <td class="text-center">
                                        <selection th:if="${item.limitType == 0}" class="text-info">组权限</selection>
                                        <selection th:if="${item.limitType == 1}" class="text-danger">用户权限</selection>
                                    </td>
                                    <td>[[${@lj.date(item.createTime)}]]</td>
                                    <td class="p-xxs">
                                        <button th:if="${@lj.limit('SysUserDetail')}>0" class="btn btn-xs btn-primary"
                                                th:ljUrl="|/sys/user/detail?id=${item.id}|" title="用户详情"
                                                target="ljOpenCon">
                                            <i class="fa fa-paste">详情</i>
                                        </button>
                                        <button th:if="${@lj.limit('SysUserEdit')}>0" class="btn btn-xs btn-success"
                                                th:ljUrl="|/sys/user/edit?id=${item.id}|" title="用户编辑"
                                                target="ljOpenCon" ljWidth="800px">
                                            <i class="fa fa-paste">编辑</i>
                                        </button>
                                        <button th:if="${@lj.limit('SysUserDel')}>0" class="btn btn-xs btn-danger"
                                                th:ljUrl="|/sys/user/del?id=${item.id}|" title="确认要删除该用户吗?"
                                                target="ljAjaxTodo">
                                            <i class="fa fa-minus-circle">删除</i>
                                        </button>
                                        <button th:if="${@lj.limit('SysUserGoogle')}>0" class="btn btn-xs btn-warning"
                                                th:ljUrl="|/sys/user/google?id=${item.id}|" title="谷歌验证码"
                                                target="ljOpenCon" ljWidth="800px">
                                            <i class="fa fa-paste">谷歌验证码</i>
                                        </button>
                                        <button th:if="${@lj.limit('SysUserPassreset')}>0" class="btn btn-xs btn-info"
                                                th:ljUrl="|/sys/user/passreset?id=${item.id}|" title="确认要重置该用户密码吗?"
                                                target="ljAjaxTodo">
                                            <i class="fa fa-paste">密码重置</i>
                                        </button>
                                        <button th:if="${@lj.limit('SysUserLimit')}>0" class="btn btn-xs btn-success"
                                                th:ljUrl="|/sys/user/limit?uid=${item.id}|" title="权限配置"
                                                target="ljOpenCon">
                                            <i class="fa fa-paste">权限配置</i>
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row no-padding ljLayPage2">
                <div class="pull-left p-lr-sm pageInfo">总条数:[[${page?.totalCount}]] 总页数:[[${page?.pageNum}]]/[[${page?.totalPage}]]</div>
                <div class="pull-right tablePage"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="system/inc/incBottom :: incBottom"></div>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
    jQuery(function ($) {
        $("#ljLayPage").width();
        $(".selectSystem").change(function () {
            window.location.href = "/sys/user?sid=" + $(this).val();
        });
        layui.use(['laypage'], function () {
            var laypage = layui.laypage;
            laypage({
                cont: $(".tablePage")
                , curr: '[[${page?.pageNum}]]'
                , pages: '[[${page?.totalPage}]]'
                , groups: 5
                , skip: true,
                jump: function (obj, first) {
                    if (!first && obj.curr != '[[${page?.pageNum}]]') {
                        $("#pageNum").val(obj.curr);
                        $("#pagerForm").submit();
                    }
                }
            });
        });
    });
    /*]]>*/
</script>
</body>
</html>
